import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    typeList: [],
    currentTypeId: 0,
    loading: false
  },
  mutations: {
    // 设置列表
    setTypeList(state, payload) {
      state.typeList = payload
    },

    // 设置类型id
    setTypeId(state, payload) {
      state.currentTypeId = payload
    },

    setLoading(state, payload) {
      state.loading = payload
    }
  },
  actions: {
  },
  modules: {
  }
})
